# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 

inherit gnome2

DESCRIPTION="Utility for network exploration with Samba support."
HOMEPAGE="http://autoscan.free.fr"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="~x86 ~ppc ~alpha ~sparc ~hppa ~amd64 ~ia64 ~mips"
IUSE=""

MY_P="AutoScan.${PV}_R1"
SRC_URI="http://autoscan.free.fr/Download/${MY_P}.tar.gz"

RDEPEND=">=gnome-base/libgnomeui-2.0 \
	net-fs/samba \
	>=gnome-extra/gtkhtml-2.0 \
	net-analyzer/nmap \
	>=net-analyzer/net-snmp-5.0"

DEPEND="${RDEPEND}
	dev-util/pkgconfig \
	x11-libs/vte \
	dev-libs/elfutils"


S="${WORKDIR}/AutoScan-${PV}_R1"

src_compile() {

	econf || die
	emake || die
}

src_install() {

	dobin "${S}"/bin/AutoScan_Network
	dobin "${S}"/bin/AutoScan_Agent

	dodir /usr/share/
	insinto /usr/share/
	doins -r "${S}"/usr/share/*
}

pkg_postinst() {

	einfo "Setting required permissions on AutoScan_Agent binary..."
	chown root:root ${ROOT}/usr/bin/AutoScan_Agent
	chmod +s ${ROOT}/usr/bin/AutoScan_Agent
}
